//
//  AnimationFactory.m
//  CarCare
//
//  Created by ileo on 14/11/5.
//  Copyright (c) 2014年 baozun. All rights reserved.
//

#import "AnimationFactory.h"

NSString * const ANIMATION_SCALE = @"transform.scale";
NSString * const ANIMATION_OPACITY = @"opacity";

@implementation AnimationFactory

+(CAKeyframeAnimation *)animationType:(NSString *)type Values:(NSArray *)values duration:(NSTimeInterval)duration{
    CAKeyframeAnimation *animation = [CAKeyframeAnimation animationWithKeyPath:type];
    animation.duration = duration;
    animation.values = values;
    return animation;
}

+(void)animationDieOutWithView:(UIView *)view finish:(void (^)())finish{
    CAAnimation *scale = [AnimationFactory animationType:ANIMATION_SCALE Values:@[@0.9,@1.05,@1] duration:0.15];
    [view.layer addAnimation:scale forKey:[NSString stringWithFormat:@"scale"]];
}

@end
